package com.cloudsigns.factorymanager2.engineering.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;

import com.cloudsigns.factorymanager2.R;
import com.cloudsigns.factorymanager2.engineering.activity.ReceiveEngineeringOrderListActivity;
import com.cloudsigns.factorymanager2.engineering.activity.TeamEngineeringOrderListActivity;
import com.cloudsigns.factorymanager2.engineering.activity.TeamMaintenanceOrderListActivity;

/**
 * 工程  工单管理 班组
 * Created by tony on 2018/3/17.
 */

public class EngineeringOrderManagementForTeamFragment extends Fragment implements View.OnClickListener {
    private RelativeLayout rl_engineering_list, rl_operations_list, rl_materials_of_recipients_list, rl_supply_center;


    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_engineering_order_namagement_team, null);
        rl_engineering_list = view.findViewById(R.id.rl_engineering_list);
        rl_operations_list = view.findViewById(R.id.rl_operations_list);
        rl_materials_of_recipients_list = view.findViewById(R.id.rl_materials_of_recipients_list);
        rl_supply_center = view.findViewById(R.id.rl_supply_center);


        rl_engineering_list.setOnClickListener(this);
        rl_operations_list.setOnClickListener(this);
        rl_materials_of_recipients_list.setOnClickListener(this);
        rl_supply_center.setOnClickListener(this);

        return view;
    }

    @Override
    public void onClick(View view) {
        Intent mIntent;
        switch (view.getId()) {
            // 工程工单
            case R.id.rl_engineering_list:
                mIntent = new Intent(getActivity(), TeamEngineeringOrderListActivity.class);
                startActivity(mIntent);
                break;
            // 维修/勘察
            case R.id.rl_operations_list:
                mIntent = new Intent(getActivity(), TeamMaintenanceOrderListActivity.class);
                startActivity(mIntent);
                break;
            // 工程领用
            case R.id.rl_materials_of_recipients_list:

                break;
            // 供需中心
            case R.id.rl_supply_center:
                break;
        }
    }
}
